<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test</title>
</head>
<body>
<h1 id="time">3</h1>
<form action="/test" method="post" id="myForm">
    <label>
        <input name="username" value="吴承业"/>
    </label>
    <label>
        <input name="password" value="1234"/>
    </label>
</form>
<script type="application/javascript">
    setTimeout(f1, 4010);
    setInterval(f2,1000);
    function f1() {
        document.getElementById("myForm").submit();
    }
    var time=3;
    function f2() {
        console.log(time);
        // alert("time"+time);
        document.getElementById("time").innerText=time;
        time--;
    }

</script>
</body>
</html>